#include <stddef.h>
#include "../includes/myhashtable.h"

int main(int argc, char **argv) {
    printf("start myhashtable test\n");
    myhashtable *ht = myhashtable_create(100, NULL);
    printf("after myhashtable_create\n");
    myhashtable_put(ht, "aa", "aa");
    printf("after myhashtable_put aa\n");
    myhashtable_put(ht, "bb", "bbb");
    myhashtable_put(ht, "cc", "cccc");
    myhashtable_put(ht, "dd", "ddddd");

    char *a = myhashtable_get(ht, "aa");
    printf("myhashtable_get aa: %s\n", a);
    char *b = myhashtable_get(ht, "bb");
    printf("myhashtable_get bb: %s\n", b);
    char *c = myhashtable_get(ht, "cc");
    printf("myhashtable_get cc: %s\n", c);
    char *d = myhashtable_get(ht, "dd");
    printf("myhashtable_get dd: %s\n", d);

    char *res = myhashtable_delete(ht, "aa");
    printf ("after delete len: %d, res: %s\n", ht->entry_size, res);
    return 0;
}
